<template>
	<view class="delivery-page">
		<tabBar selectedIndex = 0></tabBar>
		<!-- <view class="site-con c-flex c-item-center">
			<image class="location-icon" :src="deliveryImgUrl+'delivery-location-icon.png'" mode=""></image>
			<text>1号站点</text>
			<image class="arrow-icon" :src="deliveryImgUrl+'delivery-arrow.png'" mode=""></image>
		</view> -->
		
		<image class="top-bg" :src="deliveryImgUrl+'delivery-top-bg.png'"></image>
		
		<view class="panel-1 c-panel c-flex jc-between c-flex-wrap">
			<view class="item c-flex jc-between c-item-center" v-for="(item,i) in panel_1" :key="i" @click="onItemClick(item)">
				<view class="">
					<view class="txt1">{{item.txt1}}</view>
					<view class="txt2">{{item.txt2}}</view>
				</view>
				<image :src="deliveryImgUrl+item.icon" mode=""></image>
			</view>
		</view>
		
		<view class="panel-2 c-panel " v-if="isShowBt">
			<view class="title">常用功能</view>
			<view class="c-flex jc-start c-flex-wrap">
				<view class="item c-flex c-flex-col jc-center c-item-center" 
							v-for="(item,i) in panel_2" :key="i" @click="onCommonFun(item)">
					<image :src="deliveryImgUrl+item.icon" mode=""></image>
					<view class="txt1">{{item.txt1}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				deliveryImgUrl: this.$API.IMG_URL + '/gas/yehuaqi/delivery/',
				panel_1:[
					{txt1:'配送管理',txt2:'精准定位 极速达',icon:'delivery-psgl.png',url:'/pages/delivery/order/order'},
					// {txt1:'溯源管理',txt2:'气瓶溯源轨迹查询',icon:'delivery-sy.png'},
					{txt1:'入库系统',txt2:'气瓶精准入库',icon:'delivery-rkxt.png',url:'/pages/delivery/stock-manage/inOrOutStock?type=1'},
					{txt1:'出库系统',txt2:'气瓶精准出库',icon:'delivery-ckxt.png',url:'/pages/delivery/stock-manage/inOrOutStock?type=2'},
				],///pages/delivery/room-check/room-check-list
				panel_2:[
					{txt1:'数据分析',icon:'delivery-sjfx.png'},{txt1:'入户安检',icon:'delivery-rhaj.png',url:''},
					{txt1:'用户地址',icon:'delivery-sqyq.png',url:'/pages/delivery/user-manage/user-list'},{txt1:'上门维修',icon:'delivery-smwx.png'},
					{txt1:'库存查询',icon:'delivery-tkgl.png',url:'/pages/delivery/stock-manage/stock-query'},{txt1:'气瓶管理',icon:'delivery-qpgl.png',url:'/pages/delivery/gasbottle-manage/index'}
				],
				isShowBt:false,
			};
		},
		onLoad() {
				this.isShowBt = uni.getStorageSync('buttonLimit');
		},
		methods:{
			onItemClick(item){
				if(item.url){
					uni.navigateTo({
						url:item.url
					})
				}else{
					uni.showToast({
							icon:"none",
							title:'功能开发中...'
					})
				}
			},
			onCommonFun(item){
				if(item.url){
					uni.navigateTo({
						url:item.url
					})
				}else{
					uni.showToast({
							icon:"none",
							title:'功能开发中...'
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
.delivery-page{
	padding:112rpx 32rpx 0;height: 100%;background-image: linear-gradient(rgba(249, 195, 115, .3) 20%,#F9F9F9 50%);font-family: PingFangSC, PingFang SC;
	.top-bg{width:666rpx;height:232rpx;margin-top: 56rpx;}
	.site-con{
		.location-icon{width: 28rpx;height: 32rpx;}
		.arrow-icon{width: 12rpx;height: 20rpx;}
		text{font-weight: 500;font-size: 28rpx;color: #000000;margin:0 8rpx;}
	}
	.c-panel{
		background: #FFFDFA;border-radius: 16rpx;border: 2rpx solid #FFFFFF;padding:28rpx;
	}
	.panel-1{
		.item{
			flex-basis: 42%;padding: 20rpx;
			.txt1{font-weight: 800;font-size: 28rpx;color: #001F42;margin-bottom:10rpx;}
			.txt2{font-weight: 400;font-size: 20rpx;color: #919191;}
			image{width:104rpx;height:104rpx;}
		}
	}
	.panel-2{
		margin-top:22rpx;
		.title{font-weight: 800;font-size: 30rpx;color: #000C31;}
		.item{
			flex-basis: 25%;    margin-top: 38rpx;
			.txt1{font-weight: 800;font-size: 28rpx;color: #001F42;margin-bottom:10rpx;}
			image{width:48rpx;height:48rpx;margin-bottom:12rpx;}
		}
	}
}
</style>
